﻿using King.Data;
using King.Repository;
using log4net;
using System.Threading.Tasks;

namespace King.Jobs
{
    public class TestTask
    {
        private readonly ILog log = LogManager.GetLogger("King", typeof(TestTask));
        private IRepository<Admin> _adminRepository;

        public TestTask(IRepository<Admin> adminRepository)
        {
            _adminRepository = adminRepository;
        }

        public async Task Run()
        {
            var c = await _adminRepository.GetOneAsync(p => p.IsAdmin == true);
            log.Info($"执行任务--查看管理员={c.UserName}");
        }

    }
}
